#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
int main()
{
    pid_t now=fork();
	if(now==0)
	{
	    pid_t id=getpid();
	    pid_t ppid=getppid();
	    while(1)
	    {   
	        printf("this is child progress,pid:%d,ppid:%d\n",id,ppid);
	        sleep(1);
		}
	}
	else if(now>0)
	{

		pid_t id=getpid();
	    pid_t ppid=getppid();
	    while(1)
	    {   
	        printf("this is parent progress,pid:%d,ppid:%d\n",id,ppid);
	        sleep(1);
		}
	}
    return 0;

}

